package com.rockcent.mall.lib.repository;

import com.rockcent.mall.lib.domain.ProductMerchantStores;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.stereotype.Repository;

import javax.persistence.LockModeType;
import java.util.List;

/**
 * Created by DK on 16/10/10.
 */
@Repository
public interface MerchantProductMerchantStoresRepository extends JpaRepository<ProductMerchantStores, Long>, JpaSpecificationExecutor {

    List<ProductMerchantStores> findByProductIdAndMerchantId(Long productId, Long merchantId);

    List<ProductMerchantStores> findByProductId(Long productId);


    void deleteByMerchantIdAndProductId(Long merchantId,Long productId);

}
